home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_basi / pa16v305.zip / TEST40.CLS < prev    next >
Text File  |  1996-05-24  |  1KB  |  77 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "TestClass"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. Dim v As Long
  11. Dim s As Byte
  12.  
  13. Const sNormal = 0, sAbnormal = 1
  14.  
  15. Private Sub Class_Initialize()
  16.  
  17. MsgBox "Object initialization OK"
  18. Style = sNormal
  19.  
  20. End Sub
  21.  
  22.  
  23. Private Sub Class_Terminate()
  24.  
  25. If Style = sAbnormal Then
  26.    Beep
  27.    TestForm.Blink
  28. End If
  29. MsgBox "Object will be destroyed. Property Value was " & Value()
  30.  
  31. End Sub
  32.  
  33.  
  34.  
  35. Public Property Get Value()
  36.  
  37. Value = v
  38.  
  39. End Property
  40.  
  41. Public Property Let Value(vNewValue)
  42.  
  43. v = vNewValue
  44.  
  45. End Property
  46.  
  47. Public Sub ShowPublicHello()
  48.  
  49. MsgBox "Hello, world! My Value is " & Value
  50. Style = sAbnormal
  51.  
  52. End Sub
  53.  
  54. Private Sub ShowPrivateHello(ThisIsAByRefParameter, Optional ByVal ThisIsAByValParameter)
  55.  
  56. MsgBox "Hello fellow!"
  57.  
  58. ThisIsAByRefParameter = "This isn't dead"
  59. ThisIsAByValParameter = "This is dead"
  60.  
  61. End Sub
  62.  
  63. Private Property Get Style()
  64.  
  65. Style = s
  66.  
  67. End Property
  68.  
  69. Private Property Let Style(vNewValue)
  70.  
  71. s = vNewValue
  72.  
  73. End Property
  74.  
  75.  
  76.  
  77.